package Pre.treeMap;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

public class LinkeedHashMaoTest {
    public static void main(String[] args) {
        LinkedHashMap<Integer,String> linkedHashMap = new LinkedHashMap<>(16,075f,true);
        linkedHashMap.put(1, "wzry");
        linkedHashMap.put(3, "yys");
        linkedHashMap.put(2, "ys");
        linkedHashMap.put(4, "qqdzz");
        linkedHashMap.put(5, "hpjy");

        System.out.println(linkedHashMap.get(4));
        System.out.println(linkedHashMap.get(1));
        System.out.println(linkedHashMap);
        System.out.println(linkedHashMap.get(2));

        Set<Map.Entry<Integer,String>> entries = linkedHashMap.entrySet();
        for (Map.Entry<Integer,String> entry: entries){
            System.out.println(entry.getKey() + entry.getValue());
        }
    }
}
